package com.example.marketing.market;


import com.example.marketing.business.Order;

import java.util.function.Predicate;

/**
 * 营销规则 - 由条件和动作组成
 */
public class MarketingRule {
    private final String ruleId;
    private final String ruleName;
    private final Predicate<Order> condition;
    private final MarketingAction action;

    public MarketingRule(String ruleId, String ruleName,
                         Predicate<Order> condition, MarketingAction action) {
        this.ruleId = ruleId;
        this.ruleName = ruleName;
        this.condition = condition;
        this.action = action;
    }

    public Predicate<Order> getCondition() {
        return condition;
    }

    public MarketingAction getAction() {
        return action;
    }

    public String getRuleId() {
        return ruleId;
    }

    public String getRuleName() {
        return ruleName;
    }
}
